#ifndef COMPRESSVIDEO_H
#define COMPRESSVIDEO_H

#include "napi/native_api.h"
#include <string>
#include "hilog/log.h"
#include <memory>
#include <js_native_api.h>
#include <js_native_api_types.h>
#include "compressVideo/muxer/Muxer.h"
#include "compressVideo/deMuxer/DeMuxer.h"
#include "napi/native_api.h"
#include "compressVideo/decoder/VideoDec.h"
#include "compressVideo/decoder/AudioDec.h"
#include "compressVideo/encoder/VideoEnc.h"
#include "compressVideo/encoder/AudioEnc.h"
#include "compressVideo/compressTools/Tools.h"

struct AsyncCallbackInfo {
    napi_env env;
    
    napi_async_work asyncWork;
    
    napi_deferred deferred;
    
    int32_t outFd = true;
    
    int32_t inputFd = true;
    
    int32_t inputOffset = 0;
    
    int64_t inputSize = 0;
    
    int32_t quality = 0;
    
    double frameRate = 0;
    
    int32_t resultCode = 0;
    
    std::string resultStr = "";
    
    std::string outputPath = "";
    
    std::string taskID = "";
};

struct VideoCompressorInfo {
    std::unique_ptr<AudioEnc> *audioEncoder;
    
    std::unique_ptr<AudioDec> *audioDecoder;
    
    std::unique_ptr<VideoDec> *videoDecoder;
    
    std::unique_ptr<VideoEnc> *videoEncoder;
    
    std::unique_ptr<DeMuxer> *deMuxer;
    
    std::unique_ptr<Muxer> *muxer;
    
    AsyncCallbackInfo *compressParams = nullptr;
    
    std::unique_ptr<MutexManager> *mutexManager;
    
    int defaultFrameRate = 0;
};

#endif // COMPRESSVIDEO_COMPRESSVIDEO_H
